<template>
  <div id="left_id">
    <el-menu
      default-active="2"
      class="el-menu-vertical-demo"
      @open="handleOpen"
      @close="handleClose"
      background-color="rgb(255, 90, 59)"
      text-color="#fff"
      active-text-color="#ffd04b"
      router
    >
      <el-menu-item index="/index">
        <i class="el-icon-menu"></i>
        <span slot="title">首页</span>
      </el-menu-item>

      <el-submenu :index="menu.title" v-for="menu in menu_list" :key="menu.id">
        <template slot="title">
          <i :class="menu.icon"></i>
          <span>{{menu.title}}</span>
        </template>
        <el-menu-item-group>
          <el-menu-item :index="m.url" v-for="m in menu.children" :key="m.id">{{m.title}}</el-menu-item>
        </el-menu-item-group>
      </el-submenu>
    </el-menu>
  </div>
</template>

<script>
export default {
  data() {
    return {
      menu_list: []
    };
  },
  methods: {
    handleOpen() {},
    handleClose() {}
  },
  created() {
    this.menu_list = JSON.parse(localStorage.getItem("log_list")).menus;
  }
};
</script>

<style>
</style>